home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-21 | 2.8 KB | 140 lines | [UVtx/UVtl] |
- ////////////////////////////////////////////////////
- ////////////////////////////////////////////////////
- ////////////////////////////////////////////////////
- ////////////////////////////////////////////////////
- /////////////////// The PieChart ///////////////////
- ////////////////////////////////////////////////////
- ////////////////////////////////////////////////////
- ////////////////////////////////////////////////////
- ////////////////// By Yuval Shavit /////////////////
- ////////////////////////////////////////////////////
- ////////////////////////////////////////////////////
- ////////////////////////////////////////////////////
- ////////////////////////////////////////////////////
- ////////////////////////////////////////////////////
- ////////////////////////////////////////////////////
-
- //first the intro..
- Up
- Goto -400,300,0
- Down
- Pen speed=500
- Pen picture="1"
- Goto -180,0,0
- Up
- Goto 400,300,0
- Down
- Pen picture="2"
- Goto 0,0,0
- Pen picture="1"
- Up
- Goto -100,-500,0
- Down
- Pen picture="r3"
- Goto -180,-180,0
- Up
- Goto 180,10,0
- Down
- Pen picture=""
- Fill 1
- Right 45
- Forward 11
- Left 135
- Forward 8
- Left 5
- Forward 8
- Left 90
- Forward 8
- Pause 1.5
- Clear
- //then a few functions...
-
- Function updown(xx,yy)
- Up
- Goto xx,yy,0
- Down
- Function space()
- updown(130,190)
- Color 65535,65535,65535
- Left 90
- Backward 3
- Fill 1
- Repeat 2
- Forward 16
- Right 90
- Forward 150
- Right 90
- Color 0,0,0
-
- //...now three variables...
-
- na=-90
- hh=-100
- pt=0
-
- //...a starting posision...
- Up
- Goto 0,0,-na
- Down
- //...and we're set!
- Function mainthing()
- Repeat
- space()
- Color 0,0,0
- Print "Percent? ",move
- p=ask(50)
- pt=pt+p
- If pt>100
- Sound "Wild Eep"
- pt=pt-p
- mainthing()
- space()
- Print "Label? ",move
- l=ask(100)
- a=(p/100)*(200*π)
- space()
- Up
- Goto 0,0,na
- Down
-
- //let's mess with colors...
- c=random(65535)
- cc=random(65535)
- ccc=random(65535)
- Color c,cc,ccc
- //now back to the actual program
-
- Fill 1
- Forward 100
- Right 90
- Circle -100
- Forward a
- Straight
- Right 90
- Forward 100
- Right 180
- na=dir()
- updown(-210,hh)
- Left 90
- Fill 1
- Repeat 4
- Forward 10
- Right 90
- Color 0,0,0
- Up
- Right 90
- Forward 12
- Down
- Print " = ".l.", ".p."%"
- hh=hh+20
- If pt=100
- space()
- Color 0,0,00
- Width 3
- Up
- Goto 101,0,90
- Down
- Circle 101
- Forward 202*π
- Halt
- mainthing()